import { BUNDLE_TYPE_ENUM } from "../base/EnumIndex";
import { UIManager } from "../manager/UIManager";
import GameUI from "./GameUI";

const { ccclass, property } = cc._decorator;

@ccclass
export default class LoseUI extends cc.Component {

    @property({ type: cc.Node, tooltip: "光" })
    private light: cc.Node = null;

    protected onLoad() {
        // this.light.stopAllActions();
        // cc.tween(this.light).repeatForever(cc.rotateBy(3.5, 360),).start();
    }

    private onBtnsClicked(event: cc.Event, data: cc.Event.EventCustom) {
        const name = event.target.name;
        switch (name) {
            case "btnBack":     // 返回
                {
                    UIManager.ins.closeAll();
                    UIManager.ins.showUI("MenuUI", BUNDLE_TYPE_ENUM.GAME_PLAY);
                }
                break;
            case "btnRestart":  // 重开
                {
                    UIManager.ins.close();
                    GameUI.instance.restartGame();
                }
                break;
        }
        // console.log("onReviveClicked()===>按钮:", name);
    }
}